import Md5 from 'js-md5'

/**
 * 获得整型随机数
 * @returns {number}
 */
export function randomSalt() {
  return Math.trunc(Math.random()*(0x7fffffff))
}

export function md5Password(password) {
  let salt = randomSalt();             //生成随机salt
  let passwordByte = password + salt
  return Md5(passwordByte);
}

let password = 'admin123'
console.log('md5Password = ',md5Password(password));
